var e = require("../@babel/runtime/helpers/typeof");

!function(r) {
    var n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
    var t = {
        encode: function(e) {
            for (var r, t, o = String(e), i = n, f = 0, a = "", d = 3 / 4; !isNaN(r = o.charCodeAt(d)) || 63 & f || (i = "=", 
            (d - 3 / 4) % 1); d += 3 / 4) if (r > 127) {
                (t = encodeURI(o.charAt(d)).split("%")).shift();
                for (var c, s = d % 1; c = t[0 | s]; s += 3 / 4) f = f << 8 | parseInt(c, 16), a += i.charAt(63 & f >> 8 - s % 1 * 8);
                d = d === 3 / 4 ? 0 : d, d += 3 / 4 * t.length % 1;
            } else f = f << 8 | r, a += i.charAt(63 & f >> 8 - d % 1 * 8);
            return a;
        },
        decode: function(e) {
            var r, t = String(e), o = n.slice(0, -1), i = [ 6, 4, 2, 0 ], f = "", a = 0, d = 0, c = "";
            try {
                for (var s = 0; (r = o.indexOf(t[s])) > -1; s++) a = a << 6 | r, s % 4 && ((d = 255 & a >> i[s % 4]) < 128 ? (f += c ? decodeURI(c) : "", 
                f += String.fromCharCode(d), c = "") : c += "%" + ("0" + d.toString(16)).slice(-2));
                return f += c ? decodeURI(c) : "";
            } catch (e) {
                throw new Error("base64 malformed!");
            }
        }
    };
    if ("function" == typeof define && define.amd) define(function() {
        return t;
    }); else if ("object" === ("undefined" == typeof exports ? "undefined" : e(exports))) for (var o in t) t.hasOwnProperty(o) && (exports[o] = t[o]); else r.base64 = t;
}("object" === ("undefined" == typeof global ? "undefined" : e(global)) && global || void 0);